<para>
The name of the X display to open instead of the one specified
-in the <envar>DISPLAY</envar> environment variable.
-</para>
-</formalpara>
-
-<formalpara>
-<title><systemitem>--screen <replaceable>screen_number</replaceable></systemitem></title>
-
-<para>
- The number of the screen within the default display. This overrides
- any screen number specified in the display name specified by
- by he <systemitem>--display</systemitem> command line option or
- the <envar>DISPLAY</envar> environment variable. If this screen
- cannot be opened, then GTK+ will fall back to the screen
- specified in the display name. This option is not useful
- interactively; the intended purposes is that when a program
- registers its command line with a <firstterm>session
- manager</firstterm> for later restarting, it can save the
- screen it is on, without having to worry if it might be
- restarted on a different display.
+in the <envar>DISPLAY</envar> environment variable.
</para>
</formalpara>
<title><systemitem>--sync</systemitem></title>
<para>
-Makes all X requests synchronously. This is a useful option for
+Makes all X requests synchronously. This is a useful option for
debugging, but it will slow down the performance considerably.
</para>
</formalpara>
{ "display", 0, G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_STRING, &_gdk_display_name,
/* Description of --display=DISPLAY in --help output */ N_("X display to use"),
/* Placeholder in --display=DISPLAY in --help output */ N_("DISPLAY") },
- { "screen", 0, 0, G_OPTION_ARG_INT, &_gdk_screen_number,
- /* Description of --screen=SCREEN in --help output */ N_("X screen to use"),
- /* Placeholder in --screen=SCREEN in --help output */ N_("SCREEN") },
#ifdef G_ENABLE_DEBUG
{ "gdk-debug", 0, 0, G_OPTION_ARG_CALLBACK, gdk_arg_debug_cb,
/* Description of --gdk-debug=FLAGS in --help output */ N_("GDK debugging flags to set"),
gdk_get_display_arg_name (void)
{
if (!_gdk_display_arg_name)
- {
- if (_gdk_screen_number >= 0)
- _gdk_display_arg_name = _gdk_windowing_substitute_screen_number (_gdk_display_name, _gdk_screen_number);
- else
- _gdk_display_arg_name = g_strdup (_gdk_display_name);
- }
+ _gdk_display_arg_name = g_strdup (_gdk_display_name);
return _gdk_display_arg_name;
}
display = gdk_display_open (gdk_get_display_arg_name ());
- if (!display && _gdk_screen_number >= 0)
- {
- g_free (_gdk_display_arg_name);
- _gdk_display_arg_name = g_strdup (_gdk_display_name);
-
- display = gdk_display_open (_gdk_display_name);
- }
-
return display;
}
guint _gdk_debug_flags = 0;
GList *_gdk_default_filters = NULL;
gchar *_gdk_display_name = NULL;
-gint _gdk_screen_number = -1;
gchar *_gdk_display_arg_name = NULL;
gboolean _gdk_native_windows = FALSE;
gboolean _gdk_disable_multidevice = FALSE;
#endif
}
-/**
- * _gdk_windowing_substitute_screen_number:
- * @display_name: The name of a display, in the form used by
- * gdk_display_open (). If %NULL a default value
- * will be used. On X11, this is derived from the DISPLAY
- * environment variable.
- * @screen_number: The number of a screen within the display
- * referred to by @display_name.
- *
- * Modifies a @display_name to make @screen_number the default
- * screen when the display is opened.
- *
- * Return value: a newly allocated string holding the resulting
- * display name. Free with g_free().
- */
-gchar *
-_gdk_windowing_substitute_screen_number (const gchar *display_name,
- gint screen_number)
+static gchar *
+substitute_screen_number (const gchar *display_name,
+ gint screen_number)
{
GString *str;
gchar *p;
- if (!display_name)
- display_name = getenv ("DISPLAY");
-
- if (!display_name)
- return NULL;
-
str = g_string_new (display_name);
p = strrchr (str->str, '.');
old_display = gdk_display_get_name (gdk_screen_get_display (screen));
- return _gdk_windowing_substitute_screen_number (old_display,
- gdk_screen_get_number (screen));
+ return substitute_screen_number (old_display,
+ gdk_screen_get_number (screen));
}
static GdkWindow *